﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using VRAEWeb.Models;
using VRAEWeb.VRAEContribuyente;

namespace VRAEWeb.Controllers
{
    public class PagoPredialController : Controller
    {
        //
        // GET: /PagoPredial/
        public ActionResult Index()
        {
            return View();
        }

        //
        // POST: /PagoPredial/
        [HttpPost]
        public ActionResult Index(FormCollection formCollection)
        {
            String sCodigo = formCollection["codigo"];
            return RedirectToAction("ListarPagos", new { sCodigoContribuyente = sCodigo });
        }

        public ActionResult ListarPagos(String sCodigoContribuyente)
        {
            VRAEPago.SPagoClient oSPagoClient = new VRAEPago.SPagoClient();
            VRAEPago.Pago[] listaPagos = oSPagoClient.obtenerPagos(sCodigoContribuyente);

            return View(listaPagos);
        }

        public ActionResult ListarCuentas()
        {
            VRAEBancoModeloDataContext db = new VRAEBancoModeloDataContext();
            List<Cuenta> lista = (from e in db.Cuenta
                                    where e.IdCliente.Equals(1)
                                    select e).ToList<Cuenta>();

            return View(lista);
        }

        public ActionResult Pagar()
        {
            return View();
        }

    }
}
